From e46693ba796e61d9b9db2a56b6b9a4735325253a Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 14 Sep 2011 20:34:39 +0000 Subject: [PATCH] Revert r96824: causes fatal errors when search query doesn't happen to be a valid title. Code doesn't appear to have been tested? --- docs/hooks.txt | 11 ----------- includes/specials/SpecialSearch.php | 18 ++++++------------ 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 8471448ab3..c2a5f6dca6 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1741,11 +1741,6 @@ $opts: FormOptions for this request &$query_options: array of options for the database request &$select: Array of columns to select -'SpecialSearchCreateLink': called when making the message to create a page or -go to the existing page -$t: title object searched for -&$params: an array of the default message name and page title (as parameter) - 'SpecialSearchGo': called when user clicked the "Go" &$title: title object generated from the text entered by the user &$term: the search term entered by the user @@ -1754,12 +1749,6 @@ $t: title object searched for target doesn't exist &$title: title object generated from the text entered by the user -'SpecialSearchPowerBox': the equivalent of SpecialSearchProfileForm for -the advanced form, a.k.a. power search box -&$showSections: an array to add values with more options to -$term: the search term (not a title object) -$opts: an array of hidden options (containing 'redirs' and 'profile') - 'SpecialSearchProfiles': allows modification of search profiles &$profiles: profiles, which can be modified. diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index ef38ee7e23..351972feba 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -411,11 +411,8 @@ class SpecialSearch extends SpecialPage { $messageName = 'searchmenu-new-nocreate'; } } - $params = array( $messageName, wfEscapeWikiText( $t->getPrefixedText() ) ); - wfRunHooks( 'SpecialSearchCreateLink', array( $t, &$params ) ); - if( $messageName ) { - $this->getOutput()->wrapWikiMsg( "

\n$1

", $params ); + $this->getOutput()->wrapWikiMsg( "

\n$1

", array( $messageName, wfEscapeWikiText( $t->getPrefixedText() ) ) ); } else { // preserve the paragraph for margins etc... $this->getOutput()->addHtml( '

' ); @@ -874,17 +871,13 @@ class SpecialSearch extends SpecialPage { } $namespaceTables .= Xml::closeElement( 'table' ); } - - $showSections = array( 'namespaceTables' => $namespaceTables ); - // Show redirects check only if backend supports it + $redirects = ''; if( $this->getSearchEngine()->supports( 'list-redirects' ) ) { - $showSections['redirects'] = + $redirects = Xml::checkLabel( wfMsg( 'powersearch-redir' ), 'redirs', 'redirs', $this->searchRedirects ); } - wfRunHooks( 'SpecialSearchPowerBox', array( &$showSections, $term, $opts ) ); - $hidden = ''; unset( $opts['redirs'] ); foreach( $opts as $key => $value ) { @@ -920,8 +913,9 @@ class SpecialSearch extends SpecialPage { ) ) . Xml::element( 'div', array( 'class' => 'divider' ), '', false ) . - implode( Xml::element( 'div', array( 'class' => 'divider' ), '', false ), $showSections ) . - $hidden . + $namespaceTables . + Xml::element( 'div', array( 'class' => 'divider' ), '', false ) . + $redirects . $hidden . Xml::closeElement( 'fieldset' ); } -- 2.20.1